import 'package:car_map/mode/spuare_type_mode.dart';
import 'package:car_map/page/routers/fluro_navigator.dart';
import 'package:car_map/page/squarepage/attractions_page/attractions_router.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'load_image.dart';

class WidgetCityInspirationItem extends StatelessWidget {
  final SpuareTypeModel spuareTypeModel;

  const WidgetCityInspirationItem({Key key, this.spuareTypeModel}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return InkWell(
      onTap: (){
        NavigatorUtils.push(context, AttractionsRoutails.attractionsDatailsPage,
            replace: false);
      },
      child: Container(
        margin: EdgeInsets.only(right: 10.0),
        width: ScreenUtil().setWidth(230.0),
        height: ScreenUtil().setHeight(300.0),
        child: Stack(
          children: <Widget>[
            LoadAssetImage(
              spuareTypeModel.urlPath,
              format: 'jpg',
              fit: BoxFit.fill,
              width: ScreenUtil().setWidth(230.0),
              height: ScreenUtil().setHeight(300.0),
            ),
            Positioned(
                height: ScreenUtil().setHeight(130.0),
                bottom: 0.0,
                child: Container(
                  width: ScreenUtil().setWidth(230.0),
                  height: ScreenUtil().setHeight(100.0),
                  decoration: BoxDecoration(
                    color: Color(0x90000000),
                  ),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Text(
                        '${spuareTypeModel.title}',
                        style: TextStyle(
                            color: Colors.white,
                            fontWeight: FontWeight.bold,
                            fontSize: ScreenUtil().setSp(25.0)),
                      ),
                      Text(
                        '${spuareTypeModel.subContent}',
                        style: TextStyle(color: Colors.white, fontSize: ScreenUtil().setSp(20.0)),
                      ),
                    ],
                  ),
                )),
            Positioned(
                left: ScreenUtil().setWidth(25.0),
                bottom: ScreenUtil().setHeight(110),
                child: Container(
                  padding: EdgeInsets.only(left: 5.0,right:5.0,top: 3.0,bottom: 3.0),
                  decoration: BoxDecoration(
                      color: Colors.yellowAccent,
                      borderRadius: BorderRadius.all(Radius.circular(5.0))
                  ),
                  child: Text('必买',style: TextStyle(fontSize: ScreenUtil().setSp(16.0)),),
                ))
          ],
        ),
      ),
    );
  }
}
